using UnityEngine;
using System.Collections;

public class ScoreKeeper : MonoBehaviour 
{
	public int score = 0;
	public int playerScore = 0;
	public int playerTrys = 3;
	
	// Use this for initialization
	void Start () 
	{

	}
	
	// Update is called once per frame
	void Update () 
	{
		if(Input.GetKey(KeyCode.Space)) Application.LoadLevel("MainMenu");
		
		DontDestroyOnLoad(transform.gameObject);
	}
	
	public int LostTry()
	{
		playerTrys -= 1;
		return playerTrys;
	}
	
	public int AddScore()
	{
		return score += 100;
	}
	
	public int SubtractScore()
	{
		return score -= 100;
	}
	
	void OnGUI()
	{		
		GUI.Label(new Rect(32,62,100,20), "Score : " + score);
		GUI.Label(new Rect(32,92,100,20), "Trys : " + playerTrys);
	} 
}